package com.itxiaowu.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itxiaowu.dao.UserDao;
import com.itxiaowu.pojo.User;
import com.itxiaowu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@Service(interfaceClass = UserService.class)
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    /**
     *  根据用户名获得用户信息
     * @param username
     * @return
     */
    @Override
    public User findByUsername(String username) {

        return userDao.findByUsername(username);

    }

//    /**
//     * 根据用户id查询用户所拥有的角色
//     *
//     * @param id
//     * @return
//     */
//    @Override
//    public List<Role> findRoleById(Integer id) {
//        return userDao.findRoleById(id);
//    }
}
